#include<iostream>
#include<cstdio>
using namespace std;
double get(double x ,double y)
{
	return 2018 * x * x * x * x + 21 * x + 5 * x * x * x + 5 * x * x + 14 - y;
}
int main()
{
	int t;
	cin >> t;
	while (t--) {
		double y;
		cin >> y;
		bool flag = 0;
		for (double i = 0; i <= 100; i += 0.0001) {
			double l = i;
			double r = i + 0.0001;
			if (get(l,y) * get(r,y) < 0) {
				printf("%.4lf\n", l);
				flag = 1;
			}
		}
		if (flag == 0) {
			cout << -1 << endl;
		}
	}
	return 0;
}